<?php
include('../../inc/global.inc');
include("../islogin.php");
$url=$_SERVER['HTTP_REFERER'];
?>
<?php
if($_POST['act_xg']){
        $c_rs=mysql_query("select * from city where id='$_POST[c_provinces]' and city_id=0");
		$c_row=mysql_fetch_array($c_rs);
		$c_rs2=mysql_query("select * from city where id='$_POST[c_city]' and city_id>0");
		$c_row2=mysql_fetch_array($c_rs2);
		$c_rs3=mysql_query("select * from city where id='$_POST[c_diqu]' and city_id>0");
		$c_row3=mysql_fetch_array($c_rs3);
		$c_provinces=($_POST[c_provinces])?$_POST[c_provinces]:0;
		$c_city=($_POST[c_city])?$_POST[c_city]:0;
		$c_diqu=($_POST[c_diqu])?$_POST[c_diqu]:0;
        $jd_lilv=$_POST[jd_lilv1]."%".$_POST[jd_lilv2];
		$jd_sh=($_POST[jd_sh])?$_POST[jd_sh]:0;
		
        mysql_query("update jd_jiedai set jd_title='$_POST[jd_title]',jd_jiner='$_POST[jd_jiner]',jd_lilv='$jd_lilv',jd_dyw='$_POST[jd_dyw]',jd_dywdz='$_POST[jd_dywdz]',jd_dywjz='$_POST[jd_dywjz]',jd_srdb='$_POST[jd_srdb]',jd_dsfdb='$_POST[jd_dsfdb]',jd_jkyt='$_POST[jd_jkyt]',jd_shuoming='$_POST[jd_shuoming]',jd_jkrmc='$_POST[jd_jkrmc]',jd_lianxiren='$_POST[jd_lianxiren]',jd_tel='$_POST[jd_tel]',jd_phone='$_POST[jd_phone]',jd_qq='$_POST[jd_qq]',jd_email='$_POST[jd_email]',jd_pro_id='$c_provinces',jd_pro='$c_row[city_name]',jd_city_id='$c_city',jd_city='$c_row2[city_name]',jd_diqu_id='$c_diqu',jd_diqu='$c_row3[city_name]',jd_xxdizhi='$_POST[jd_xxdizhi]',jd_cl=1,jd_sh='$jd_sh' where id='".$_POST['iid']."'");


echo "<script>alert('提交成功');location='".$_POST['urls']."';</script>";
}
?>
<HTML>
<HEAD>
<TITLE>Admin</TITLE>
<META http-equiv=Content-Type content="text/html; charset=utf-8">
<LINK href="../css/css.css" rel=stylesheet>
<script type='text/javascript' src="../js/islogin.js" charset="gb2312"></script>
<script type='text/javascript' src="../js/shijian.js"></script>
<script type="text/javascript" src="/js/city.js" charset="gb2312"></script>
</HEAD>
<BODY>
<center>

  <table width="780" border="0" cellpadding="0" cellspacing="1" bgcolor="#000000">
    <tr>
      <td height="25" bgcolor="#EEEEF9" style="padding-left:5px;">借款信息&nbsp;&nbsp;<a href="javascript:history.go(-1)">返回</a></td>
    </tr>
  </table>
<?php
$sql="select * from jd_jiedai where id=".$_GET['xg_id'];
$rs=mysql_query($sql);
$row=mysql_fetch_array($rs)
?>
<TABLE cellSpacing=1 cellPadding=5 width="780" bgColor=#000000 border=0>
  <TBODY>
  <FORM name="form1" action="" method="post">
  <tr>
    <td align="center" bgcolor="#8DA8CF" colspan="2" height="45"><span style="padding-left:5px;">借款信息</span></td>
  </tr>
  <TR>
    <TD align=center width="17%" bgColor=#eff6ff>借贷标题：</TD>
    <TD width="83%" bgColor="#f9f9f9"><INPUT id="jd_title" maxLength="250" size="50" name="jd_title" value="<?=$row[jd_title]?>"></TD>
  </TR>
  <TR>
    <TD align=center bgColor=#eff6ff>借款金额：</TD>
    <TD style="PADDING-LEFT: 4px;" bgColor="#f9f9f9"><input name="jd_jiner" type="text" size="10" value="<?=$row[jd_jiner]?>">
    万元</TD>
  </TR>
  <?php $jd_lilv=explode("%",$row[jd_lilv]);?>
  <TR>
    <TD align=center bgColor=#eff6ff>接受利率：</TD>
    <TD bgColor="#f9f9f9"><input name="jd_lilv1" type="text" id="jd_lilv1" value="<?=$jd_lilv[0]?>" size="5" maxlength="10" /> %
    <select id="jd_lilv2" name="jd_lilv2">
        <option value="年" <?php if($jd_lilv[0]=="年"){echo "selected";}?>>年</option>
        <option value="月" <?php if($jd_lilv[1]=="月"){echo "selected";}?>>月</option>
    </select></TD>
  </TR>
  <TR>
    <TD align=center bgColor=#eff6ff>低押物名：</TD>
    <TD style="PADDING-LEFT: 4px;" bgColor="#f9f9f9"><input name="jd_dyw" type="text" size="30" value="<?=$row[jd_dyw]?>"></TD>
  </TR>
  <TR>
    <TD align=center bgColor=#eff6ff>第三方担保：</TD>
    <TD bgColor="#f9f9f9"><INPUT name="jd_dsfdb" id="jd_dsfdb" value="<?=$row[jd_dsfdb]?>" size="30"></TD>
  </TR>
  <TR>
    <TD align=center bgColor=#eff6ff>低押物价值：</TD>
    <TD bgColor="#f9f9f9"><INPUT name="jd_dywjz" id="jd_dywjz" value="<?=$row[jd_dywjz]?>" size="10"></TD>
  </TR>
  <TR>
    <TD align=center bgColor=#eff6ff>个人收入担保：</TD>
    <TD bgColor="#f9f9f9"><INPUT name="jd_srdb" id="jd_srdb" value="<?=$row[jd_srdb]?>" size="30"></TD>
  </TR>
  <TR>
    <TD align=center bgColor=#eff6ff>低押物地址：</TD>
    <TD bgColor="#f9f9f9"><INPUT name="jd_dywdz" id="jd_dywdz" value="<?=$row[jd_dywdz]?>" size="30"></TD>
  </TR> 
  <TR>
    <TD align=center bgColor=#eff6ff>借款用途：</TD>
    <TD bgColor="#f9f9f9"><INPUT name="jd_jkyt" id="jd_jkyt" value="<?=$row[jd_jkyt]?>" size="30"></TD>
  </TR>
  <TR>
    <TD align=center bgColor=#eff6ff>借款说明：</TD>
    <TD bgColor="#f9f9f9"><textarea id="jd_shuoming" name="jd_shuoming" cols="70" rows="20"><?=$row[jd_shuoming]?></textarea></TD>
  </TR> 
  <TR>
    <TD align=center bgColor=#eff6ff>借款人名称：</TD>
    <TD bgColor="#f9f9f9"><INPUT name="jd_jkrmc" id="jd_jkrmc" value="<?=$row[jd_jkrmc]?>" size="40"></TD>
  </TR>
  <TR>
    <TD align=center bgColor=#eff6ff>联系人：</TD>
    <TD bgColor="#f9f9f9"><INPUT name="jd_lianxiren" id="jd_lianxiren" value="<?=$row[jd_lianxiren]?>" size="20"></TD>
  </TR>
  <TR>
    <TD align=center bgColor=#eff6ff>电话：</TD>
    <TD bgColor="#f9f9f9"><INPUT name="jd_tel" id="jd_tel" value="<?=$row[jd_tel]?>" size="20"></TD>
  </TR>
  <TR>
    <TD align=center bgColor=#eff6ff>手机：</TD>
    <TD bgColor="#f9f9f9"><input name="jd_phone" id="jd_phone" value="<?=$row[jd_phone]?>" size="20"></TD>
  </TR>
  <TR>
    <TD align=center bgColor=#eff6ff>在线联系：</TD>
    <TD bgColor="#f9f9f9"><INPUT name="jd_qq" id="jd_qq" value="<?=$row[jd_qq]?>" size="35"></TD>
  </TR>
  <TR>
    <TD align=center bgColor=#eff6ff>邮箱：</TD>
    <TD bgColor="#f9f9f9"><INPUT name="jd_email" id="jd_email" value="<?=$row[jd_email]?>" size="35"></TD>
  </TR>
  <TR>
    <TD align=center bgColor=#eff6ff>所在地区：</TD>
    <TD bgColor="#f9f9f9"><select name="c_provinces" onChange="changecity(document.form1.c_provinces.options[document.form1.c_provinces.selectedIndex].value)">
<option value="">--选择省份--</option>    
<?    
$rs01=mysql_query("select * from city where city_id=0 order by order_name asc");    
while($res=mysql_fetch_array($rs01)){    
?>    
<option value="<?=$res['id']?>" <?php if($row[jd_pro_id]==$res[id]){echo "selected";}?>><?=$res['city_name']?></option> 
<? } ?>    
</select>     
<select name="c_city" id="c_city"  onChange="changecity2(document.form1.c_city.options[document.form1.c_city.selectedIndex].value)">                    
  <option value="">--选择城市--</option>
  			<?php
			$rs2=mysql_query("select * from city where city_id='$row[jd_pro_id]' order by id asc");
			while($row2=mysql_fetch_array($rs2)){
			?>
			<option value="<?=$row2['id']?>" <?php if($row[jd_city_id]==$row2[id]){echo "selected";}?>><?=$row2['city_name']?></option>
			<?php
			}?>  
</select>
	   <select name="c_diqu" id="c_diqu">
            <option value="">--选择地区--</option>
			<?php
			$rs3=mysql_query("select * from city where city_id='$row[jd_city_id]' order by id asc");
			while($row3=mysql_fetch_array($rs3)){
			?>
			<option value="<?=$row3['id']?>" <?php if($row[jd_diqu_id]==$row3[id]){echo "selected";}?>><?=$row3[city_name]?></option>
			<?php
			}?> 
       </select></TD>
  </TR>
  <TR>
    <TD align=center bgColor=#eff6ff>详细地址：</TD>
    <TD bgColor="#f9f9f9"><INPUT id="jd_xxdizhi" size="50" name="jd_xxdizhi" value="<?=$row[jd_xxdizhi]?>"></TD>
  </TR>
	 <tr>
	   <td height="25" align="center" bgcolor="#eff6ff">审核通过</td>
	   <td bgcolor="#ffffff" style="padding-left:3px;"><input type="radio" name="jd_sh" value="1" <?php if($row[jd_sh]==1){echo "checked";}?>>是<input type="radio" name="jd_sh" value="0" <?php if($row[jd_sh]==0){echo "checked";}?>>否</td>
  </tr>
  <TR>
    <TD align=middle bgColor=#eff6ff>&nbsp;</TD>
	<input type="hidden" name="act_xg" value="ok">
	<input type="hidden" name="iid" value="<?=$row['id']?>">
	<input type="hidden" name="urls" value="<?=$_SERVER['HTTP_REFERER']?>">
    <TD bgColor="#f9f9f9"><input name="submit" type="submit" value="提交"></TD>
  </TR>
  </FORM>
</TABLE>
</center>
</BODY>
</HTML>

